import {
  CREATE,
  DELETE,
  EDITOR,
  STATE_CHANGE,
  FILTER
} from '../constants/actionTypes';

//添加list的Action Creator
export const todoCreate = (text) => {
  return {
    type: CREATE,
    text
  };
};

//删除list的Action Creator
export const todoDelete = (id) => {
  return {
    type: DELETE,
    id
  };
};

//编辑list的Action Creator
export const todoEditor = (id, text) => {
  return {
    type: EDITOR,
    id: id,
    text: text
  };
};

//改变list状态的Action Creator
export const todoStateChange = (id) => {
  return {
    type: STATE_CHANGE,
    id: id
  };
};

//list展示
export const todoFilter = (fliter) => {
  return {
    type: FILTER,
    fliter
  };
};